//
//  NSMutableDictionary+ATKit.m
//  Postre
//
//  Created by CoderLT on 2017/6/24.
//  Copyright © 2017年 CoderLT. All rights reserved.
//

#import "NSMutableDictionary+ATKit.h"

@implementation NSMutableDictionary (ATKit)
- (void)setParam:(id)object forKey:(NSString *)key {
    if (object && key.length) {
        [self setObject:object forKey:key];
    }
}
@end

@implementation NSArray (ATKit)

- (id)objectSafeAtIndex:(NSUInteger)index {
    return index < self.count ? [self objectAtIndex:index] : nil;
}
- (id)secondObject {
    return [self objectSafeAtIndex:1];
}
@end

@implementation NSMutableArray (ATKit)

- (void)addSafeObject:(id)anObject {
    if (anObject) {
        [self addObject:anObject];
    }
}
@end
